package hd3.wordcount;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * @Author: laoyu
 * @Date: 2020/6/4 12:18
 * @Description:
 */
public class WcPartition extends Partitioner<Text, IntWritable> {

    @Override
    public int getPartition(Text key, IntWritable value, int numPartitions) {
        if ((key.toString().compareTo("a") < 0)) {
            return 0;
        } else {
            return 1;
        }
    }
}
